package project.dade.cn.bst.adapter.base;

import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

import cn.bingoogolapple.androidcommon.adapter.BGARecyclerViewAdapter;
import cn.bingoogolapple.androidcommon.adapter.BGAViewHolderHelper;
import project.dade.cn.bst.R;
import project.dade.cn.bst.model.MyfeedsDate;

/**
 * Created by vain zhou on 2016/1/14.
 */
public class MyfeedsViewAdapter extends BGARecyclerViewAdapter<MyfeedsDate> {


    public MyfeedsViewAdapter(RecyclerView recyclerView) {
        super(recyclerView, R.layout.item_myfeeds);
    }
    @Override
    public void setItemChildListener(final BGAViewHolderHelper viewHolderHelper) {
        viewHolderHelper.setItemChildClickListener(R.id.iv_dustbean);
    }



        @Override
    protected void fillData(BGAViewHolderHelper helper, int position, MyfeedsDate myfeedsDate) {
        ImageView avatorIv =helper.getView(R.id.iv_photo);
        Glide.with(mContext).load(myfeedsDate.getProductImage()).placeholder(R.drawable.image_loader_small).error(R.drawable.image_loader_small).into(avatorIv);
        helper.setText(R.id.tv_title, myfeedsDate.getProductName());
        helper.setText(R.id.tv_sell, myfeedsDate.getPrice());


    }
}
